package com.ddx.check;

import com.ddx.common.enums.ErrorCode;
import com.ddx.common.exception.BusinessException;
import com.ddx.common.util.AssertUtil;
import com.ddx.dto.ShoppingOrderVo;
import org.apache.commons.lang3.StringUtils;

/**
 * @author dudianbo
 * @ClassName: CheckUserParamValidate
 * @Description: 用户操作校验类
 * @date 2018/4/18
 */
public class CheckOrderParamValidate {
    /**
     * 校验登录参数
     * @param shoppingOrderVo
     * @throws BusinessException
     */
    public static void checkCreateOrder(ShoppingOrderVo shoppingOrderVo) throws BusinessException {
        if(StringUtils.isBlank(shoppingOrderVo.getAddressId())){
            throw  new BusinessException(ErrorCode.BUSSINESS_ERROR_212);
        }

    }
    /**
     * 代取需求订单---支付
     * @param shoppingOrderVo
     * @throws BusinessException
     */
    public static void weixinPayMailDemand(ShoppingOrderVo shoppingOrderVo) throws BusinessException {
        AssertUtil.isNotNull(shoppingOrderVo.getUserId(),"userId为空");
        AssertUtil.isNotNull(shoppingOrderVo.getOrderId(),"orderId为空");
    }

}
